This invention relates to optical devices functioning as all-optical logic gates. More specifically, digital optical signals are combined and provided to nonlinear elements such as optical resonators or cavity switches whose resonance frequencies are tuned to produce desired logic output signals.